<extend name="Base/ucmobile_base" />
<block name="style">
  <style>
    .header {
      text-align: center;
    }
    .header h1 {
      font-size: 200%;
      color: #333;
      margin-top: 30px;
    }
    .header p {
      font-size: 14px;
    }
  </style>
</block>
<block name="body">
    <ul class="am-nav am-nav-pills am-nav-justify">
        <php> if(!C('SYSTEM_CLOSE_REGISTER')) { </php> <li><a href="{:U('User/register')}">新用户注册</a></li> <php> } </php>
        <php> if(!C('SYSTEM_CLOSE_ADMIN')) { </php><li><a href="{:U('admin/index/index')}" target="_blank">后台管理</a></li><php> } </php>
        <php> if(!C('SYSTEM_CLOSE_WIKI')) { </php><li><a href="http://bbs.uctoo.com/" target="_blank">二次开发教程</a></li><php> } </php>
        <php> if(!C('SYSTEM_CLOSE_BBS')) { </php><li><a href="http://bbs.uctoo.com/" target="_blank">官方论坛</a></li><php> } </php>
	</ul>
<section class="login_box">
<div class="header">
  <div class="am-g">
      <a href="{:SITE_URL}">
          <php> if(!C('SYSTEM_LOGO')) { </php>
          <img src="{:SITE_URL}/Public/Home/images/logo_text.png" />
          <php> } else { </php>
          <img src="{:C('SYSTEM_LOGO')}" />
          <php> } </php>
      </a>
    <p>{:C('WEB_SITE_TITLE')}</p>
  </div>
  <hr />
</div>
<div class="am-g">
  <div class="am-u-lg-6 am-u-md-8 am-u-sm-centered">

	<form class="am-form" action="__SELF__" method="post">
        <fieldset>
            <legend>登录</legend>



        <div class="am-input-group">
            <span class="am-input-group-label"><i class="am-icon-user"></i></span>
            <input type="text" id="inputEmail" class="am-form-field" placeholder="请输入用户名" ajaxurl="/member/checkUserNameUnique.html" errormsg="请填写1-16位用户名" nullmsg="请填写用户名" datatype="*1-16" value="" name="username">
        </div>

        <div class="am-input-group">
            <span class="am-input-group-label"><i class="am-icon-lock"></i></span>
            <input type="password" id="inputPassword" class="am-form-field" placeholder="请输入密码" errormsg="密码为6-20位" nullmsg="请填写密码" datatype="*6-20" name="password">
        </div>
        <php>if(C('WEB_SITE_VERIFY')) { </php>
   		<div class="am-input-group">
            <span class="am-input-group-label"><i class="am-icon-keyboard-o"></i></span>
            <input type="text" id="verify" placeholder="请输入验证码"  errormsg="请填写5位验证码" nullmsg="请填写验证码" datatype="*5-5" name="verify">
        </div>
        <div class="am-input-group">
            <img class="verifyimg reloadverify" alt="点击切换" src="{:U('verify')}" style="cursor:pointer;">
            <a href="javascript:;" class="reloadverify_a">换一张?</a>
        </div>

        <php> } </php>
              <div class="controls Validform_checktip text-warning"></div>
              <div class="control-group">
			  <label for="remember-me">
              <input id="remember-me" type="checkbox">
                 记住密码
              </label>
                
      <div class="am-cf">
        <input type="submit" name="" value="登 录" class="am-btn am-btn-primary am-btn-sm am-fl">
        <input name="" value="忘记密码? " class="am-btn am-btn-default am-btn-sm am-fr">
      </div>

              </div>
        </fieldset>
       </form>
       <hr>
   </div>
</div>
</section>
</block>
<block name="side"> </block>
<block name="script">
	<script type="text/javascript">       
    	$(document)		   
	    	.ajaxStart(function(){
	    		$("button:submit").addClass("log-in").attr("disabled", true);
	    	})
	    	.ajaxStop(function(){
	    		$("button:submit").removeClass("log-in").attr("disabled", false);
	    	});


    	$("form").submit(function(){
    		var self = $(this);
    		$.post(self.attr("action"), self.serialize(), success, "json");
    		return false;

    		function success(data){
    			if(data.status){
    				window.location.href = data.url;
    			} else {
    				self.find(".Validform_checktip").text(data.info);
    				//刷新验证码
    				$(".reloadverify").click();
    			}
    		}
    	});

		$(function(){
			var verifyimg = $(".verifyimg").attr("src");
            $(".reloadverify,.reloadverify_a").click(function(){
                if( verifyimg.indexOf('?')>0){
                    $(".verifyimg").attr("src", verifyimg+'&random='+Math.random());
                }else{
                    $(".verifyimg").attr("src", verifyimg.replace(/\?.*$/,'')+'?'+Math.random());
                }
            });
			$('input').focus(function(){
				$(this).parent().find('.fa').css('color','#1dbd03');
				})
			$('input').blur(function(){
				$(this).parent().find('.fa').css('color','#aaa');
				})
		});
	</script>
</block>
